<template>
  <div style="display:inline-block;margin-left:15px;">
    <a-breadcrumb class="breadcrumb">
      <a-breadcrumb-item v-for="(item, index) in breadList" :key="item.name">
        <router-link
          v-if="index != 1"
          :to="{ path: item.path === '' ? '/' : item.path }"
          >{{ item.meta.title }}</router-link
        >
        <span v-else-if="item.path !='/console/configuration/home/index'">{{ item.meta.title }}</span>
      </a-breadcrumb-item>
    </a-breadcrumb>
  </div>
</template>
 
<script>
export default {
  data() {
    return {
      name: "",
      breadList: [],
      routes: [],
    };
  },
  created() {
    this.getBreadcrumb();
  },
  methods: {
    getBreadcrumb() {
      this.breadList = [];
      //this.name = this.$route.name;
      console.log(this.$route)
      this.$route.matched.forEach((item) => {
          this.breadList.push(item);
      });
      console.log(this.breadList)
    },
  },
  watch: {
    $route() {
      this.getBreadcrumb();
    },
  },
};
</script>
<style lang="stylus" scoped>
</style>